// Tags:
#include <cstdio>

const int N = 1e7 + 5;
int a, b, cnt, pri[N / 10], val[N];
bool vis[N];

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("T1.in", "r", stdin);
  freopen("T1.out", "w", stdout);
#endif
#endif

  scanf("%d%d", &a, &b);
  for (int i = 2; i <= b; ++i) {
    if (!vis[i]) {
      pri[++cnt] = i;
      long long tmp = i;
      while (tmp <= b) {
        val[tmp] = i;
        tmp *= i;
      }
    }
    for (int j = 1; j <= cnt && pri[j] * i <= b; ++j) {
      vis[i * pri[j]] = true;
      if (i % pri[j] == 0) break;
    }
  }
  long long ans = 0;
  for (int i = a; i <= b; ++i) {
    ans += val[i] ? val[i] : 1;
  }
  printf("%lld", ans);
  return 0;
}